﻿@model RedSand.Site.Models.CustomPcInfo
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $('#edit-info').click(function (event) {
            $(this).addClass('active');
            $('#product-info').show();
            $('#edit-properties').removeClass('active');
            $('#product-properties').hide();
            fixHeight();
            event.preventDefault();
        });
        $('#edit-properties').click(function (event) {
            $(this).addClass('active');
            $('#product-info').hide();
            $('#edit-info').removeClass('active');
            $('#product-properties').show();
            event.preventDefault();
        });
        $('#product-info').hide();
    });

    if ('@ViewBag.Create'=='True') {
        $('.panel-searchbox form').ajaxSubmit({
            target: '#list-wrap',
            success: function () {
                autoZen();
            }
        })
    }

</script>
<div class="dialog" title="Edit" style="width: 750px">
    <div class="panel-toolbar">
        <ul>
            <li>
                <a href="#" class="btn-edit" id="edit-info">Edit Info</a>
            </li>
            <li>
                <a href="#" class="btn-edit active" id="edit-properties">Custom PC</a>
            </li>
        </ul>
    </div>
    <div id="product-info">
    @using (Ajax.BeginForm(AdminAjaxOptions.UpdateRecord))
    {
        <div class="dialog-content">
            <div style="float: left; width: 504px">
                @Html.HiddenFor(model => model.CustomPcID)
                <div class="form-cell none-float">
                    @Html.LabelFor(model => model.Name)
                    @Html.EditorFor(model => model.Name)
                </div>
                <div class="form-cell none-float">
                    @Html.LabelFor(model => model.Alias)
                    @Html.EditorFor(model => model.Alias)
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.CategoryID)
                    @Html.Action("SelectListIsCustomPc", "Category", new { validate = true, selectedValue = Model.CategoryID })
                </div>
                <div class="form-cell">
                    <label>Price</label>
                    @Html.TextBoxFor(model => model.Price)
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.Status)
                    @Html.DropDownListFor(model => model.Status, DropDownListHelper.GetStatusList(false))
                </div>
                 <div class="clear"></div>
                <div class="form-cell none-float">
                    @Html.LabelFor(model => model.Image)
                    @Html.HiddenFor(model => model.Image)
                    <input type="text" id="choose-avatar" class="choose-file" name="NewImage"/>
                </div>
            </div>
            <div style="float: right; width: 180px;  height:179px; overflow:auto; margin: 25px 5px 0 0">
                <img id="upload-image-preview" alt="" src="@Model.Image" style="width:100%" />
            </div>
            <div class="clear"></div>
            <div class="form-cell none-float">
                @Html.LabelFor(model => model.Details)
                <textarea name="Details" id="Details2" class="editor">@Model.Details</textarea>
            </div>
        </div>
        <div class="dialog-footer">
            <input type="submit" value="Save" id="save-product-info" style="display:none"/>
            <input type="button" value="Save" onclick="$('#save-product-properties').click()" />
            <input type="button" value="Cancel" onclick="closeDialog('.dialog')" />
        </div>
    }
    </div>
    @Html.Action("components", new { id = Model.CustomPcID })
</div>
